<?php
/**
 *
 * PHP 5
 *
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */
$cakeDescription = __d('cake_dev', 'CakePHP: the rapid development php framework');
?>

<!DOCTYPE html>
<html>
    <head>
<!--        <style>
            body {
                padding-top: 60px;
                padding-bottom: 40px;
            }
        </style>-->
        <?php echo $this->Html->charset(); ?>
        <title>
            Projeto Incorpore -
            <?php echo $title_for_layout; ?>
        </title>
        <?php
        echo $this->Html->meta('icon');
        //echo $this->Html->css('bootstrap.min'); 
        //echo $this->Html->css('cake.generic');
//         echo $this->Html->css('style');
        echo $this->fetch('meta');
        //echo $this->fetch('css');        
        //echo $this->fetch('script');
        echo $this->Html->css('bootstrap');
        echo $this->Html->css('style');
        //echo $this->Html->script('jquery');
        echo $this->Html->script('http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js');
        echo $this->Html->script('bootstrap');
        echo $this->Html->script('jquery.tablesorter.pager');
        echo $this->Html->script('jquery.tablesorter.widgets');
        ?>
        <script>
            $(document).ready(function()
            {
                $('#tabela').tablesorter();
            }
            );
        </script>
    </head>
    <body>        
        <div class = "nav teste hlt-80">
            <div class = "container">

                <a href = "/incorpore" class = "inco-logo"><?php echo $this->Html->image('incorpore60.png', array('class' => 'img-responsive  margin-t1-10', 'alt' => 'Grupo Incorpore')); ?> </a>

                <button class = "navbar-toggle" data-toggle = "collapse" data-target = ".navHeaderCollapse"  style="background:#83BB2B;">
                    <span class = "icon-var"></span>
                    <span class = "icon-bar"></span>
                    <span class = "icon-bar"></span>

                </button>

                <div class = "collapse navbar-collapse navHeaderCollapse">
                    <ul class = "nav navbar-nav teste1"> 

                        <li class = "<?php if ($title_for_layout == "Produtos") echo "active"; ?>"><a class =""  href = "/incorpore/produtos/search"><?php echo __('RESÍDUOS') ?></a></li>
                        <!--<li class = "dropdown">
                               
                                <a href = "#" class = "dropdown-toggle" data-toggle = "dropdown">Projeto <b class = "caret"></b></a>
                                <ul class = "dropdown-menu">
                                        <li><a href = "#">Twitter</a></li>
                                        <li><a href = "#">Facebook</a></li>
                                        <li><a href = "#">Google+</a></li>
                                        <li><a href = "#">Instagram</a></li>
                                </ul>
                       
                        </li>
                        <li><a href = "/incorpore/projeto"></a></li>
                        <li><a href = "/incorpore/contato"></a></li>-->
                        <li class="<?php if ($title_for_layout == "Reservas") echo "active"; ?>"><a href=" /incorpore/reservas"><?= _('RESERVAS') ?><?php echo isset($numero_reservas) ? "<span class=\"badge\">" . $numero_reservas . "</span>" : ""; ?></a></li>
                        <?php
                        if (AuthComponent::user('cargo') == 'admin') {
                            echo "<li class='";
                            if ($title_for_layout == "Usuarios")
                                echo "active"; echo "'\>";
                            echo $this->Html->link(__('USUARIOS'), array('controller' => 'usuarios', 'action' => 'listAll'));
                            echo "</li><li>";
                            echo $this->Html->link(__('PRODUTOS'), array('controller' => 'produtos', 'action' => 'index'));
                            echo "</li><li class='";
                            if ($title_for_layout == "Laboratorios")
                                echo "active"; echo "'\>";
                            echo $this->Html->link(__('LABORATORIOS'), array('controller' => 'laboratorios', 'action' => 'index'));
                            echo "</li><li>";
                        } else if (AuthComponent::user('cargo') == 'funcionario') {

                            echo "<li>";
                            echo $this->Html->link(__('PRODUTOS'), array('controller' => 'produtos', 'action' => 'index'));
                            echo "</li><li>";
                            echo $this->Html->link(__('HISTORICO'), array('controller' => 'produtos', 'action' => 'viewHistorico'));
                            echo "</li><li class='";
                            if ($title_for_layout == "reservas")
                                echo "active"; echo "'\>";
                            echo $this->Html->link(__('RESERVA'), array('controller' => 'reservas', 'action' => 'index'));
                            echo "</li>";
                        }
                        ?>

                    </ul>
                    <div id="status-user" class="nav navbar-nav">
                        <?php if (AuthComponent::user('id') == null) { ?>
                            <form class="navbar-form navbar-left form-group" id="UsuarioLoginForm" accept-charset="utf-8" method="post" controller="usuarios" action="/incorpore/usuarios/login">
                                <input type="text" id='UsuarioUsuario' name='data[Usuario][usuario]' class="navbar-login nav-input com-icone icone-usuario">
                                <input type="password" id="UsuarioSenha" name="data[Usuario][senha]" class="navbar-login nav-input com-icone icone-senha">
                                <button type="submit" class="navbar-login nav-submit" >OK</button>
                                <div class="lembrar">                                    
                                        <input id="lembrar" name="lembrar" type="checkbox"><?= __('Continuar conectado'); ?>
                                </div>
                            </form>
                            <?php
                        } else {
                            ?>
                            <div id="user-logado" class="btn-group">
                                <button class="btn btn-st-user dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-user"></span><?php echo ' ' . AuthComponent::user('usuario') . ' '; ?><span class="caret"></span></button>
                                <ul class="dropdown-menu">

                                    <li><a href="/incorpore/usuarios/edit/<?php echo AuthComponent::user('id') ?>"><i class="glyphicon glyphicon-user"></i> <?php echo __('Editar minha conta'); ?></a></li>
                                    <li class="divider"></li>
                                    <li><a href="/incorpore/usuarios/logout"><i class="glyphicon glyphicon-off"></i> <?php echo __('Sair'); ?></a></li>
                                </ul>
                            </div>
                        <?php } ?>
                    </div>
                </div>

            </div>
        </div>

        <div id="container">
            <div id="header">

            </div>
            <div id="content">

                <?php echo $this->Session->flash(); ?>

                <?php echo $this->fetch('content'); ?>
            </div>
            <div id="footer">
                <?php echo $this->Html->image('incorpore-branco.png', array('class' => 'imgs-footer', 'alt' => 'Incorpore')); ?>
                <?php echo $this->Html->image('ufsm-branco.png', array('class' => 'imgs-footer', 'alt' => 'UFSM')); ?>
                <?php echo $this->Html->image('interpet-branco.png', array('class' => 'imgs-footer', 'alt' => 'Interpet')); ?>
            </div>
            <div id="footer2"> 
                <p>Grupo Incorpore</p><span>2014</span>
                <a href="" onclick="window.scrollTo(0, 0);"><?php echo $this->Html->image('gotop.png', array('class' => 'img-footer2', 'alt' => 'Ir para o topo')); ?></a>
            </div>
        </div>
    </body>

</html>
